package gui.specialGUIs;

import gui.designComponents.TMTNormalButton;
import gui.designComponents.TMTPanel;

import java.util.ResourceBundle;

import util.Auth;
import app.Controller;
import app.Model;
import bundles.BundleLoader;
import definitions.Commands;

/**
 * Button Panel to control Member Overview
 * 
 * @author MK
 * 
 */
public class MemberOverviewButtonPanel extends TMTPanel {

	public MemberOverviewButtonPanel(Model model, Controller controller) {

		ResourceBundle texts = BundleLoader.getResourceBundle();

		Boolean authorized = Auth.getAuthorization(null, model);

		if (authorized) {
			TMTNormalButton newMemberButton = new TMTNormalButton(texts
					.getString("createNewMember"));
			newMemberButton.setActionCommand(Commands.SHOW_MEMBER_CREATE);
			newMemberButton.addActionListener(controller);

			add(newMemberButton);
		}

		TMTNormalButton editMemberButton = new TMTNormalButton(texts
				.getString("editExistingMember"));
		editMemberButton.setActionCommand(Commands.SHOW_MEMBER_UPDATE);
		editMemberButton.addActionListener(controller);

		add(editMemberButton);
	}
}